@extends('front.common.header')


@section('title','青苜社区')


@section('head')
	 @parent
@stop


@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('/css/bbs/index.css') }}" />
	<div class="first_center">
	    <div class="heade_m">
	    	<ul>
	    		<li style="width: 70px; text-align: center"><a href="/bbs">首页</a></li>
	    		{{--<li><span>|</span></li>
	    		<li style="width: 70px; text-align: center"><a href="{{ url('/bbs/list') }}" target="_blank">版块</a></li>--}}
	    	</ul>
            <div class="search fr" style="">
                <input type="text" id="bbs_keyword" name="keyword" class="bbs_keyword" placeholder="搜索话题和用户" value="">
                <input type="submit" id="bbs_searchbtn" value="" />
            </div>
            <script type="text/javascript">
			$(function(){
				$("#bbs_searchbtn").click(function(){
			        var kw = $("#bbs_keyword").val();
			        if(kw.length != 0){
			            window.location.href = '/bbs/search/'+kw;
			        }
			    });
			});
            </script>
	    </div>
		<div class="first_min">
			<div class="first_min_left fl">
                  <div class="bbs_banner">
                        <ul class="bbs_banner_imgs">
                            @foreach ($banners as $key => $banners)
                            <li>
                                <a href="{{$banners->link}}" target="_blank">
                                    <img src="{{$banners->attachment->url}}"/>
                                </a>
                            </li>
                            @endforeach
                        </ul>
                        <div class="num">
                            <ul></ul>
                        </div>
                        <a class="prev" href="javascript:void(0)"></a>
                        <a class="next" href="javascript:void(0)"></a>
                  </div>
                  <script>
                    /*鼠标移过，左右按钮显示*/
                    $(".bbs_banner").hover(function(){
                       $(this).find(".prev,.next").fadeTo("show",0.5);
                    },function(){
                       $(this).find(".prev,.next").hide();
                      })
                    $(".bbs_banner").slide({
                        titCell:".num ul" ,
                        mainCell:".bbs_banner_imgs" ,
                        effect:"fold",
                        autoPlay:true,
                        interTime:3000,
                        delayTime:1000,
                        autoPage:true
                    });
                </script>
				<div id="bbs_list">
					@foreach($hotuestion as $hq)
						<div class="bbs-list-line">
                            <div class="bbs-list-img fl">
                                <a href="{{url('/bbs/'.$hq->question_id)}}">
                                    <img src="{{$hq->thumb}}" width="390" height="250">
                                </a>
                            </div>
                            <div class="bbs-list-info fl">
                                <a href="{{url('/bbs/board/'.$hq->getQuestion->category->id)}}"><span class="cate-tit">{{$hq->categoryName}}</span></a>
                                <div class="font-20 color-15 mt-10">
                                    <a href="{{url('/bbs/'.$hq->question_id)}}">{{$hq->getQuestion->title}}</a>
                                </div>
                                <div class="bbs-list-count">
                                    <span><img src="{{ asset('/images/front/neweye.png') }}">&nbsp;{{$hq->getQuestion->focus_count}}</span>
                                    <span><img src="{{ asset('/images/front/newchat.png') }}">&nbsp;{{$hq->getQuestion->answer_count}}</span>
                                    <span>{{$hq->username}}</span>
                                    <span>{{$hq->created }}</span>
                                    <a href="{{url('/bbs/'.$hq->question_id)}}" class="fr">阅读全文</a>
                                </div>
                                <div class="bbs-list-detail">{{str_limit($hq->intro,270)}}</div>
                            </div>
                            <div class="clr"></div>
						</div>
	            	@endforeach
				</div>
	            <div class="jz">
	                <a href="javascript:void(0)" id="getMore">下拉继续加载...</a>
	                <input type="hidden" name="pages" value="{{$pages}}" />
	            </div>
	            <script>
	                $(function(){
	                	$("#getMore").click(function(){
	                		var p = $("input[name=pages]").val();
	                		$.ajax({
	                        type:'GET',
	                        url:'/bbs',
	                        data:"pages="+p,
	                        dataType:'json',
	                        success:function(data){
	                            if(data.status == 'success'){
	                            	var result = data.data;
	                            	var html = '';
	                            	$.each(result,function(k,e){
	                            		html += '<div class="bbs-list-line">'
        	                                   +'    <div class="bbs-list-img fl">'
        	                                   +'       <a href="/bbs/'+e.question_id+'">'
        	                                   +'           <img src="'+e.thumb+'" width="390" height="250">'
        	                                   +'       </a>'
        	                                   +'   </div>'
        	                                   +'   <div class="bbs-list-info fl">'
        	                                   +'       <a href="/bbs/board/'+e.categoryId+'"><span class="cate-tit">'+e.categoryName+'</span></a>'
        	                                   +'		<div class="font-20 color-15 mt-10"><a href="/bbs/'+e.question_id+'">'+e.title+'</a></div>'
        	                                   +'       <div class="bbs-list-count">'
        	                                   +'           <span><img src="/images/front/neweye.png">&nbsp;'+e.focus_count+'</span>'
        	                                   +'           <span><img src="/images/front/newchat.png">&nbsp;'+e.answer_count+'</span>'
        	                                   +'           <span>'+e.username+'</span>'
        	                                   +'           <span>'+e.created+'</span>'
        	                                   +'           <a href="/bbs/'+e.question_id+'" class="fr">阅读全文</a>'
        	                                   +'       </div>'
        	                                   +'       <div class="bbs-list-detail">'+e.intro+'</div>'
        	                                   +'   </div>'
        	                                   +'   <div class="clr"></div>'
        	                                   +'</div>';
	                            	});
	                            	$("input[name=pages]").val(data.pages);
	                            	$('#bbs_list').append(html);
	                            }else{
	                               $("#getMore").html(data.msg);
	                            }
	                        }
	                    	});
	                	})
	                })
	            </script>
			</div>
            <div class="first_min_right fr">
              {{--<div class="first_min_right_qd">
                  <img src="../images/front/qd-bg.png" />
                  <span>签到</span>
               </div>
               <div class="first_min_right_jf">
                  <img src="../images/front/jf_bg.png" />
                  <span>+5积分</span>
                </div>--}}
				<div class="first_min_right_qd">
					<img style="width: 295px;height: 151px;" src="../images/front/bbs-sign.jpg" />
				</div>
				<div class="first_min_right_top">
					<a @if(!empty($authuser)) href="{{url('/bbs/post')}}" @else href="javascript:void(0)" onclick="loginTips()"@endif>我要发帖</a>
				</div>
			    <div class="bbs-plate">
				   <div class="font-18 color-15 bbs-right-div-ti bbs-div-ti-border">热门板块</div>
	               <ul class="clearfix">
	                  @foreach($hotbbs as $ke=>$vo)
	                    <li class="@if($ke%2 == 0) border_r_b @else border_b @endif">
	                      <a href="{{url('/bbs/board/'.$vo->id)}}">{{str_limit($vo->title,14)}}</a>
	                    </li>
	                  @endforeach
	               </ul>
			    </div>
			    <div class="bbs-plate mt-20">
			        <div class="font-18 color-15 bbs-right-div-ti bbs-div-ti-border">社区热帖</div>
                   @foreach($hotpost as $key=>$hotp)
					<dl class="one @if($key == 0) mt-15 @endif">
						<dt><span class="fl">·</span>&nbsp;<a href="{{url('/bbs/'.$hotp->id)}}">{{str_limit($hotp->title,28)}}</a></dt>
					</dl>
                   @endforeach
			    </div>
                <div class="bbs-plate mt-20">
                    <div class="font-18 color-15 bbs-right-div-ti bbs-div-ti-border">热门精华</div>
                    @foreach($hotemploy as $key=>$hote)
                    <dl class="one @if($key == 0) mt-15 @endif">
                        <dt><span class="fl">·</span>&nbsp;<a href="{{ url('/employ/'.$hote->id) }}" title="{{$hote->title}}">{{str_limit($hote->title,28)}}</a></dt>
                    </dl>
                    @endforeach
                </div>
                <div class="bbs-plate mt-20">
                    <div class="font-18 color-15 bbs-right-div-ti bbs-div-ti-border">热门课程</div>
                    @foreach($hotteaches as $key=>$hott)
                    <dl class="one @if($key == 0) mt-15 @endif">
                        <dt><span class="fl">·</span>&nbsp;<a href="{{url('/teaches/'.$hott->id)}}" title="{{$hott->name}}">{{str_limit($hott->name,28)}}</a></dt>
                    </dl>
                    @endforeach
                </div>
				</div>

              </div>
			</div>
		</div>
	</div>
@stop

<!--底部导航-->
@section('footer')
	@parent
@stop

